function ajaxRequest(){
	 var activexmodes=["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
	 if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
	  for (var i=0; i<activexmodes.length; i++){
	   try{
	   
		return new ActiveXObject(activexmodes[i])
	   }
	   catch(e){
		//suppress error
	   }
	  }
	 }
	 else if (window.XMLHttpRequest) // if Mozilla, Safari etc
	 {
	  return new XMLHttpRequest()
	  }
	 else
	 {
	 
	  return false
	  }
	}
var executed = 0;
function AjaxRequest(caseName)
{
	var mygetrequest=new ajaxRequest()
		mygetrequest.onreadystatechange=function(){
		 if (mygetrequest.readyState==4){
		  if (mygetrequest.status==200 || window.location.href.indexOf("http")==-1){
		 
		  var pattern = "/view/TN50_batch/job/"+caseName+"/(\\d*)/\"";
		  
		  var regws=new RegExp(pattern,"i");
		  var newstr0=mygetrequest.responseText.replace(regws,"http://us000877:8080/view/TN50_batch/job/"+caseName+"/ws/log/current/index.html\" TARGET=\"summaryFrame\"");
		  
		  var reg=new RegExp(pattern,"g");
		  
		  var newstr=newstr0.replace(reg,"http://us000877:8080/view/TN50_batch/job/"+caseName+"/$1/artifact/log/current/index.html\" TARGET=\"summaryFrame\"");
		  
		  var regImage = new RegExp("/static/edca586c/images","g");
		  var newstr1 = newstr.replace(regImage ,"http://us000877:8080/static/edca586c/images");
		  var regdeletenotusedstring = new RegExp("/view/TN50_batch/job/"+caseName+"/buildHistory/ajax","g")
		  var newstr2 = newstr1.replace(regdeletenotusedstring,"http://us000877:8080/view/TN50_batch/job/"+caseName+"/buildHistory/ajax");
		  var newconsole = new RegExp("/view/TN50_batch/job/"+caseName+"/(\\d*)/console\"","g");
		  var newstr3 = newstr2.replace(newconsole,"http://us000877:8080/view/TN50_batch/job/"+caseName+"/$1/console\" TARGET=\"summaryFrame\"");
     	 // alert(newstr2);
		 if(executed == 0) 
		 {
		 //   alert("execute javascript correct");
			executed = 1;
		}
		  document.getElementById("loadAllBuildHistory1").innerHTML=newstr3;
		   
		  }
		  else{
		   alert("An error has occured making the request");
		  }
		 }
		}
		mygetrequest.open("GET", "http://us000877:8080/view/TN50_batch/job/"+caseName+"/buildHistory/all", true);
		mygetrequest.send(null);
}
